<extend name="Index/index"/>

<block name="content">
    <!--<div class="view-product" style="margin-top: 50px">-->
    <div class="info-center">
        <div class="manage-head">
            <h6 class="padding-left manage-head-con">{{$title}}</h6>
        </div>
        <div class="offcial-table input-table table-margin clearfix">
            <div class="demoTable">
                <form action="{{:U('Communicate/index')}}" method="get">
                    作者：
                    <div class="layui-inline">
                        <input class="layui-input" name="name"  autocomplete="off">
                    </div>
                    &nbsp;文章分类：
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <select name="sort" lay-search="" class="form-control">
                                <option value="">所有</option>
                                <foreach name="sortList" item="val">
                                    <eq name="val.is_use" value="1">
                                    <option value="{{$val.id}}">{{$val.name}}</option>
                                    </eq>
                                </foreach>
                            </select>
                        </div>
                    </div>
                    &nbsp;时间：
                    <div class="layui-inline">
                        <input class="layui-input" style="width: 200px" name="time" id="test1"  autocomplete="off">
                    </div>
                    &nbsp;显示：
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <select name="is_show" lay-search="" class="form-control">
                                <option value="">所有</option>
                                <option value="2">隐藏</option>
                                <option value="1">显示</option>
                            </select>
                        </div>
                    </div>
                    &nbsp;排序：
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <select name="order" lay-search="" class="form-control">
                                <option value="c.id" selected>ID</option>
                                <option value="c.publish_time">发布时间</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <select name="order1" lay-search="" class="form-control">
                                <option value="asc" selected>正序</option>
                                <option value="desc">倒序</option>
                            </select>
                        </div>
                    </div>

                    <input type="submit" value="搜索" class="layui-btn">
                </form>
            </div>
            <if condition="$comList eq null">
                <div class="tr non-info show border-bottom-none">
                    <span>没查询到符合条件的记录</span>
                </div>
                <else />
                <table class="layui-table text-center">
                    <colgroup>
                        <col width="5%">
                        <col width="15%">
                        <col width="15%">
                        <col width="35%">
                        <col width="10%">
                        <col width="10%">
                        <col width="10%">
                    </colgroup>
                    <tr>
                        <th class="text-center">ID</th>
                        <th class="text-center">作者</th>
                        <th class="text-center">文章分类</th>
                        <th class="text-center">标题</th>
                        <th class="text-center">是否显示</th>
                        <th class="text-center">发布时间</th>
                        <th class="text-center">操作</th>
                    </tr>
                    <foreach  name="comList" item="vo" key="k">
                        <tr>
                            <td>{{$vo.id}}</td>
                            <td>{{$vo.name}}</td>
                            <td>{{$vo.sort_name}}</td>
                            <td><a href="{{:U('Communicate/queryArtInfo',array('id'=>$vo['id']))}}">{{$vo.title}}</a></td>
                            <td>
                                <eq name="vo.is_show" value="1">
                                    <a href="{{:U('Communicate/isShow',array('id'=>$vo['id'],'show'=>$vo['is_show']))}}"><i class="layui-icon" style="color: #1E9FFF;">&#xe618;</i></a>
                                    <else/>
                                    <a href="{{:U('Communicate/isShow',array('id'=>$vo['id'],'show'=>$vo['is_show']))}}"><i class="layui-icon" style="color: #1E9FFF;">&#x1006;</i></a>
                                </eq>
                            </td>
                            <td>{{:substr($vo['publish_time'],0,10)}}</td>
                            <td><a href="{{:U('Communicate/queryArtInfo',array('id'=>$vo['id']))}}" class="layui-btn layui-btn-sm layui-btn-normal">查看详情</a></td>
                        </tr>
                    </foreach>
                    <tr>
                        <td colspan="6"><div class="sabrosus">{{$page}}</div></td>
                    </tr>
                </table>

            </if>

        </div>
    </div>
    <!--</div>-->
    <script>
        layui.use('laydate', function() {
            var laydate = layui.laydate;
            //年选择器
            laydate.render({
                elem: '#test1'
                ,range: true
            });
        });

    </script>
</block>